<template>
    <div class="child8">
        <button @click="sendMsg('hello, father ~')">点击触发父组件的自定义事件，并传递数据给父组件</button>
    </div>
</template>

<script>
export default {
    name: 'Child8',
    methods: {
        sendMsg(msg) {
            this.$emit('get-data-from-child-8', msg);
        }
    }
}
</script>

<style scoped>
.child8 {
    margin-top: 5px;
}
</style>